PostAddsense


태그 : Math 요약보기전체보기목록닫기

1

RectangularGrid

Codepublic class RectangularGrid{    public long countRectangles(int width, int height) {        long res = 0;    &nbs...

ExerciseMachine

Codepublic class ExerciseMachine {    public int getPercentages(String time) {        int total = Integer.parseInt(time.substring(0, 2)) *...

BadClock

Codepublic class BadClock{    public double nextAgreement (String trueTime, String skewTime, int hourlyGain) {        double tSec = Double...

WhichData

Codeimport java.util.ArrayList;import java.util.Arrays;public class WhichData{    public int[] bestVariance(int[] sampleData, int varNum, int varDen) {    &nb...

Mandelbrot

Codepublic class Mandelbrot{    public int iterations(int max, double a, double b) {        double za = a, zb = b;        for (int i=0; i <= max;...

DivideByZero

Codeimport java.util.Arrays;import java.util.HashSet;public class DivideByZero{    public int CountNumbers(int[] numbers) {        HashSet...

Inchworm

Codepublic class Inchworm {    public int gcd(int a, int b) {        return b==0 ? a : gcd(b,a%b);    }    int lcm(int a, i...

Commision

Codepublic class Commission{    public double equivalentSales(double sales, double cost, double commission) {        return sales * (100 - 20 - cost) / (100 - commissio...

Scale

Codepublic class Scale{    public String[] scale(int x, int y, String[] image) {        int m = image.length;        int n = image[0].length(); ...

Archimedes

Codepublic class Archimedes {    public double approximatePi(int numSides) {        double d = 2 * Math.PI / numSides / 2;  // 2*Math.PI is 360 degrees.  &nbs...
1