Skip to content

Instantly share code, notes, and snippets.

:octocat:
At school

Alice alice-0-kim

:octocat:
At school
Block or report user

Report or block alice-0-kim

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View leetcode.java
class Solution {
private boolean isDigit(String s) {
return s.matches("\\d");
}
private String generate(String unit, int times) {
StringBuilder sb = new StringBuilder();
while (times > 0) {
sb.append(unit);
times--;
View Google_Kickstart_2019_Solution.java
// Round F
// Flattening
import java.io.*;
import java.util.*;
public class Solution {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int T = in.nextInt();
for (int t = 1; t <= T; t++) {
View candy.java
/**
There are N children standing in a line. Each child is assigned a rating value. You are giving candies to these children subjected to the following requirements:
1. Each child must have at least one candy.
2. Children with a higher rating get more candies than their neighbors.
What is the minimum candies you must give?
*/
import java.util.*;
public int candy(int[] ratings) {
int N = ratings.length;
@alice-0-kim
alice-0-kim / solution.java
Created May 19, 2019
A starter template for Google Code Jam and Kickstart
View solution.java
import java.io.*;
import java.util.*;
public class Solution {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int T = in.nextInt();
for (int t = 1; t <= T; t++) {
int n = 0;
System.out.printf("Case #%d: %d\n", t, n);
@alice-0-kim
alice-0-kim / main.java
Last active May 8, 2019
Cracking the Coding: Practice Problem
View main.java
// ch 8.7
import java.util.*;
public class Main {
public static void main(String args[]) {
System.out.println(getPerms("ab")); // [ab, ba]
System.out.println(getPerms("abc")); // [abc, acb, bac, bca, cab, cba]
System.out.println(getPerms("love")); // [love, loev, lvoe, lveo, leov, levo, olve, olev, ovle, ovel, oelv, oevl, vloe, vleo, vole, voel, velo, veol, elov, elvo, eolv, eovl, evlo, evol]
}
static ArrayList < String > getPerms(String input) {
You can’t perform that action at this time.