Skip to content · ⁨الانتقال إلى المحتوى⁩

Longest common prefix · ⁨أطول بادئة مشتركة⁩

English

Longest common prefix

Return the longest string that starts every word in the array. For flower, flow, flight it's fl; if there's nothing in common, return "". Start with the first word as a guess and shrink it against each next word until it fits them all.

العربية

أطول بادئة مشتركة

أعد أطول سلسلة تبدأ بها كل كلمة في المصفوفة. بالنسبة لـ flower, flow, flight هي fl؛ إذا لم يكن هناك شيء مشترك، أعد "". ابدأ بالكلمة الأولى كخمين واضغطها ضد كل كلمة تالية حتى تتناسب مع الجميع.

Log in or create account · ⁨تسجيل الدخول أو إنشاء حساب⁩

IGCSE, A-Level & AP