1.1k 1 分鐘

⭐️⭐️⭐️ # 題目敘述 You are given an integer array nums and an integer x . In one operation, you can either remove the leftmost or the rightmost element from the array nums and subtract its value from x . Note that this modifies the array for future operations. Return the minimum number of operations to...
2.2k 2 分鐘

🌕🌑🌑🌑🌑 # 題目連結 題目連結 Online Judge uDebug # 題目說明 Time limit: 3.000 seconds # 題目 Given a number, we can form a number chain by arranging its digits in descending order arranging its digits in ascending order subtracting the number obtained in (2) from the number obtained (1) to form a new...
1.9k 2 分鐘

🌕🌑🌑🌑🌑 # 題目連結 題目連結 Online Judge uDebug # 題目說明 Time limit: 3.000 seconds # 題目 The number 3025 has a remarkable quirk: if you split its decimal representation in two strings of equal length ( 30 and 25 ) and square the sum of the numbers so obtained, you obtain the original...
1.2k 1 分鐘

⭐️⭐️⭐️ # 題目敘述 Given an array of integers nums containing n + 1 integers where each integer is in the range [1, n] inclusive. There is only one repeated number in nums , return this repeated number. You must solve the problem without modifying the array nums and uses only constant extra space. #...
1.3k 1 分鐘

⭐️ # 題目敘述 You are given an m x n binary matrix mat of 1 's (representing soldiers) and 0 's (representing civilians). The soldiers are positioned in front of the civilians. That is, all the 1 's will appear to the left of all the 0 's in each row. A row i is weaker than a row j if...
2.8k 3 分鐘

🌕🌑🌑🌑🌑 # 題目連結 題目連結 Online Judge uDebug # 題目說明 Time limit: 3.000 seconds # 題目 Gondwanaland Telecom makes charges for calls according to distance and time of day. The basis of the charging is contained in the following schedule, where the charging step is related to the distance: Charging Step...
2.8k 3 分鐘

🌕🌗🌑🌑🌑 # 題目連結 題目連結 Online Judge uDebug # 題目說明 Time limit: 3.000 seconds # 題目 The game of Spot is played on an N × N board as shown below for N = 4 . During the game, alternate players may either place a black counter (spot) in an empty square or remove one from the board, thus producing a...
1.8k 2 分鐘

⭐️⭐️⭐️⭐️⭐️ # 題目敘述 You have an undirected, connected graph of n nodes labeled from 0 to n - 1 . You are given an array graph where graph[i] is a list of all the nodes connected with node i by an edge. Return the length of the shortest path that visits every node. You may start and stop at any node,...
1.1k 1 分鐘

🌕🌑🌑🌑🌑 # 題目連結 題目連結 Online Judge uDebug # 題目說明 Time limit: 3.000 seconds # 題目 Ugly numbers are numbers whose only prime factors are 2 , 3 or 5 . The sequence 1,  2,  3,  4,  5,  6,  8,  9,  10,  12,  15,  ...1,\ \ 2,\ \ 3,\ \ 4,\ \ 5,\ \ 6,\ \ 8,\ \ 9,\ \ 10,\ \ 12,\ \ 15,\ \...
5.5k 5 分鐘

🌕🌑🌑🌑🌑 # 題目連結 題目連結 Online Judge uDebug # 題目說明 Time limit: 3.000 seconds # 題目 Robotics, robot motion planning, and machine learning are areas that cross the boundaries of many of the subdisciplines that comprise Computer Science: artificial intelligence, algorithms and complexity, electrical...