Longest common prefix · أطول بادئة مشتركة
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؛ إذا لم يكن هناك شيء مشترك، أعد "". ابدأ بالكلمة الأولى كخمين واضغطها ضد كل كلمة تالية حتى تتناسب مع الجميع.
Complete longestCommonPrefix(String[] strs) returning the longest prefix shared by every string. Return an empty string if there is none or the array is empty. · أكمل longestCommonPrefix(String[] strs) تُرجع أطول بادئة مشتركة بين كل النصوص. ارجع نصاً فارغاً إذا لم يكن هناك أو المصفوفة فارغة.
Click Run to see the output here. · اضغط تشغيل لرؤية المخرجات هنا.