セクション 2. 章 2
single
Arrays Intersection
メニューを表示するにはスワイプしてください
Now we will try to create a program that will find the intersection of the 2 arrays.
Look at the explanation of the task! How does it work?
Use hints if needed! Be careful with the tabulation!
タスク
スワイプしてコーディングを開始
- Set while loop to work while the
leftis lower than theright. - Set the
middlevariable. Themiddleequals the(left + right) // 2. - Set the condition if the middle element is greater or equals the
x. - Update the
left. Theleftequals themiddle + 1. - Create an empty array to fill it with values to test the function.
- Set for loop to work with the
numsarray. - Append the
ito theintersection_nums. - Print the
intersection_nums.
解答
すべて明確でしたか?
フィードバックありがとうございます!
セクション 2. 章 2
single
AIに質問する
AIに質問する
何でも質問するか、提案された質問の1つを試してチャットを始めてください