随笔分类 -  Array

摘要:link class Solution { public: bool isTransformable(string s, string t) { vector<deque<int>> pos(10); for(int i=0;i<s.size();i++){ pos[s[i]-'0'].push_b 阅读全文
posted @ 2020-09-15 08:23 feibilun 阅读(87) 评论(0) 推荐(0)
摘要:link prove: @interviewrecipes https://leetcode.com/problems/minimum-swaps-to-arrange-a-binary-grid/discuss/768076/Min-Adjacent-Swaps-to-Sort-the-array 阅读全文
posted @ 2020-08-04 11:05 feibilun 阅读(166) 评论(0) 推荐(0)
摘要:Link class Solution { public: void sortColors(vector<int>& nums) { int low=0; int high=nums.size()-1; for(int i=0;i<=high;){ if(nums[i]==0){ swap(nums 阅读全文
posted @ 2020-06-12 07:51 feibilun 阅读(57) 评论(0) 推荐(0)