菜单(在题目上右击出现) open question:打开题目,在题目上双击也可以打开 open content:查看描述,包含图片(依赖 Markdown) Submit:提交题目 Submissions:查看提交记录,在弹出的窗口上选择记录查看详情(Show detail) Run Code:运行代码,默认使用题目的测试用例 Testcase:自定义测试用例 favorite:添加或移除收藏 Clear cac...
Language:All Sort:Recently updated threeal/leetspace Star1 A dedicated workspace and archive for my LeetCode submissions leetcodecompetitive-programmingleetcode-solutionsleetcode-cpp UpdatedMay 16, 2025 C++ testingRdp221/IPMP Star0 Code Issues
Submissions:View the submission record, select the record details in the pop-up window(Show detail) Run Code:Run the code, the test case for the question is used by default Testcase:Customize test cases favorite:Add or remove favorite Clear cache:Clean up the current question Timer:Timer,...
Total Accepted: 5206 Total Submissions: 15760 Given an array and a value, remove all instances of that value in place and return the new length. The order of elements can be changed. It doesn't matter what you leave beyond the new length. classSolution {public:intremoveElement(intA[],int...
Accepted: 6309 Total Submissions: 15558 Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321 ```c++ class Solution { public: int reverse(int x) { if(x==0) return 0; int tmp1 = 0, tmp2 = 0; ...
ss.clear();if((*it) =="+"){ operand_b=st.top(); st.pop(); operand_a=st.top(); st.pop(); st.push(operand_a+operand_b); }elseif((*it) =="-"){ operand_b=st.top(); st.pop(); operand_a=st.top(); st.pop(); ...
Two rectangles overlap if the area of their intersection ispositive. To be clear, two rectangles that only touch at the corner or edges do not overlap. Given two axis-aligned rectanglesrec1andrec2, returntrueif they overlap, otherwise returnfalse. ...
leetcode 215 - Kth Largest Element in an Arrayhttps://leetcode.com/submissions/detail/373414295/(解题思路: 二分插入方法,选个标定点比如nums[left],然后遍历数组,比nuns[left]小的放在左边,比它大的放右边,然后找到标定元素的位置) leetcode 88合并两个有序数组 (解题思路:从数组尾部开始合并,比较两个数...
Substring with Concatenation of All Words 33. Search in Rotated Sorted Array 34. Find First and Last Position of Element in Sorted Array 35. Search Insert Position 36. Valid Sudoku 37. Sudoku Solver 39. Combination Sum 40. Combination Sum II 41. First Missing Positive 42. Trapping Rain ...
原题地址:https://leetcode-cn.com/problems/gray-code/submissions/题目描述:格雷编码是一个二进制数字系统,在该系统中,两个连续的数值仅有一个... -310 -2对于给定的n,其格雷编码序列并不唯一。例如,[0,2,3,1] 也是一个有效的格雷编码序列。 00 -010 -211-301-1示例2: 输入:0 ...