1.שאלות הגיון הדורשות מחשבה מחוץ לקופסא
כמו:
יש שלושה מתגים בחדר אחד ושלוש מנורות בחדר אחר
אפשר לעבור בין החדרים רק פעם אחת
איך תדע איזה מתג שייך לכל מנורה
תשובות
הוסף תשובה
|
לצפיה בתשובות
אוקטובר 2018
אני ידליק את אחד המתגים ל10 דקות יכבה אותו וידליק מתג אחר , מיד יכנס לחדר שבו יש את המנורות , המנורה החמה שייכת למתג שסגרתי , המנורה הדליקה שייכת למתג שנדלקתי והמנורה שלא חמה ולא דליקה שייכת למתג שלא נגעתי בו
given as input a: vector> tree.
Where tree[0] is level 1 and tree[1] is level two, etc.
and the list is names of all nodes in the same level (ordered from left to right).
You also have method isParent(String child,string parent)
you need to print the tree in pre-order();
תשובות
הוסף תשובה
|
לצפיה בתשובות
פברואר 2019
given:
vector as [[5][3, 7][1, 4, 6, 8]]
answer:
void printVector(V, depth=0, part=0){
for(int i = 0; i <= depth, i++){
print(V[depth][i+part]
printVector(V, depth+1, depth*i)
}
will print the tree in preorder: 5 3 1 4 7 6 8
יולי 2019
יעבוד רק בעץ מושלם צריך לקרא לפונק' is parent לכל node
For number n, how many trailing zeroes there are in n!
תשובות
הוסף תשובה
|
לצפיה בתשובות
אפריל 2020
רמז: ניתן לפתור ב: log(n)
מרץ 2021
number of 5 factors between 1 to n
ינואר 2022
צריך לבדוק כמה מספרים מתחלקים ב5 עד n, ואז כמה מספרים מתחלקים ב5^2 וכו..
כלומר, תיקח לוג 5 של n, ולעגל כלפי מטה, ואז לרוץ בלולאה על החלוקה של המספר ב5 בחזקה
ראיון קצר של שעה + יום ראיונות (5 ראיונות, חלקם בעברית וחלקם באנגלית)
שאלות מתוך הראיון
You have a yearly schedule of vacations for each of the offices of your company. You can go from office to office once a week, on the weekend, using one flight- any office to any office (you don't have to switch to a different office, but you can). Build a plan to maximize your yearly vacation time.
Second part:
Not any office is connected to any other office - each office has a certain set of "neighbors" you can get to in a weekend. Plan for the with this constraint.