بکندباز

یک تابع ایجاد کنید که یک لیست از آیتم را گرفته و بررسی کند که آیا آخرین آیتم با بقیه لیست که به هم متصل شده‌اند مطابقت دارد.

نمونه ورودی و خروجی

MatchLastItem(["rsq", "6hi", "g", "rsq6hig"]) ➞ True

MatchLastItem([1, 1, 1, "11"]) ➞ False

MatchLastItem([8, "thunder", True, "8thunderTrue"]) ➞ True
Assert.True(Backendbaz.MatchLastItem(new object[] { "rsq", "6hi", "g", "rsq6hig" }));
Assert.False(Backendbaz.MatchLastItem(new object[] { 1, 1, 1, "11" }));
Assert.True(Backendbaz.MatchLastItem(new object[] { 8, "thunder", true, "8thunderTrue" }));

هنوز پاسخی برای این تمرین ثبت نشده است

نظرات

*
*

تمرینات مرتبط