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. · לחץ על הרץ כדי לראות את התוצא כאן.