LeetCode:75. Sort Colors
来源:互联网 发布:长江证券mac版本 编辑:程序博客网 时间:2024/06/15 13:22
Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue.
Here, we will use the integers 0, 1, and 2 to represent the color red, white, and blue respectively.
这道题感觉自己用了一个sort的算法,然后就OK了。
AC:
class Solution {public: void sortColors(vector<int>& nums) { sort(nums.begin(),nums.end()); }};
0 0
- [LeetCode]75.Sort Colors
- LeetCode --- 75. Sort Colors
- [Leetcode] 75. Sort Colors
- [leetcode] 75.Sort Colors
- 【leetcode】75. Sort Colors
- [leetcode] 75. Sort Colors
- Leetcode 75. Sort Colors
- *LeetCode 75. Sort Colors
- 75. Sort Colors LeetCode
- Leetcode 75. Sort Colors
- [LeetCode]75. Sort Colors
- LeetCode 75. Sort Colors
- LeetCode *** 75. Sort Colors
- leetcode 75. Sort Colors
- LeetCode 75. Sort Colors
- leetcode-75. Sort Colors
- [leetcode]75. Sort Colors
- LeetCode-75.Sort Colors
- web网站服务--Nginx
- Java实现常见的排序算法
- Hibernate基础复习
- 神经网络之BP算法
- 织梦cms教程:自定义表单添加提交时间
- LeetCode:75. Sort Colors
- 滴滴面试总结
- 1111. Online Map (30)
- TCP可靠的数据传输
- 用thymeleaf用标签给页面select下拉框赋值
- CodeForces 755APolandBall and Hypothesis
- properties 的操作和运用实例
- TCP四次挥手
- 无法打开模块文件“C:\Users\Cathy\AppData\Local\Temp\.NETFramework,Version=v4.5.AssemblyAttributes.vb”