Skip to content

Instantly share code, notes, and snippets.

View abbath0767's full-sized avatar

Nikita Gusarov abbath0767

View GitHub Profile
public class Vowels {
public static int getCount(String str) {
int vowelsCount = 0;
vowelsCount = str.length() - str.replaceAll("a|e|i|o|u", "").length();
return vowelsCount;
}
public class DivisibleNb {
public static Boolean isDivisible(long n, long x, long y) {
return (n % x == 0 && n % y == 0);
}
}
@abbath0767
abbath0767 / gist:d42830a89ca651f9df2f
Created February 24, 2016 15:32
Beginner Series #2 Clock
import java.util.*;
public class Clock
{
public static int Past(int h, int m, int s)
{
Date d = new Date();
int year = d.getYear();
int month = d.getMonth();
int day = d.getDate();
@abbath0767
abbath0767 / gist:11b9c1b79c20ed4188c9
Created February 24, 2016 15:32
7 kyu Sort the Gift Code
import java.util.Arrays;
public class GiftSorter{
public String sortGiftCode(String code){
String[] arrayOfSymbol = code.split("");
Arrays.sort(arrayOfSymbol);
StringBuilder sb = new StringBuilder();
for (String oneSymbol: arrayOfSymbol)
sb.append(oneSymbol);