שלחו מבחן בית במייל חוזר אחרי שהגשתי קורות חיים באתר שלהם
שאלות מתוך הראיון
קלט של מחרוזת עם אותיות וצריך למפות 26 אותיות באנגלית ל 9 מקשים בנייד כך שמספר הלחיצות על המקשים יהיה מינימלי ולהחזיר את מספר הלחיצות המינימלי. כך שאם נגיד a,b,c ממופים לאותו מקש אז צריך ללחוץ על המקש פעם 1 כדי לקבל a, פעמיים כדי ללחוץ על b, ושלוש פעמיים כדי ללחוץ על c.
תשובות
הוסף תשובה
|
לצפיה בתשובות
אוגוסט 2023
להשתמש ב hashTable של map/dict לכל אות לרשום את מספר הפעמים שמופיע במחרוזת ולפי התדירות להחליט לאיפה "למקם" במקשים.
a regex pattern consists of lowercase English letters and some wildcard characters (?) with any English character. two patterns are called intersecting if the wildcard characters in the respective strings can be changed in a way to form the same string from both patterns. for example patterns p = "?cc?" and q="dc??" intersect as we can form s="dccx" from both p and q. given an array patterns of n regex strings, find the minimum number of '?' characters possible in a pattern that intersects with all the patterns.