| [ Web Proxy ] |
| Viewing: https://raw.githubusercontent.com/freestylewill/JavaArithmetic/master/src/LeetCode/Leetcode75.java | [Back] [Original] |
package LeetCode;
//https://leetcode.com/problems/sort-colors/description/
public class Leetcode75 {
/**
*
*
* @param nums
*/
// : O(n)
// : O(1)
public void sortColors(int[] nums) {
int[] count = {0, 0, 0}; // 0, 1, 2
for (int i = 0; i < nums.length; i++) {
assert nums[i] >= 0 && nums[i]
| Web Proxy Viewer | New URL | Original Page |