This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=begin | |
You are in charge of the cake for a child's birthday. You have decided the cake will have one candle for each year of their total age. They will only be able to blow out the tallest of the candles. Count how many candles are tallest. | |
Example | |
The maximum height candles are units high. There are of them, so return . | |
Function Description |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Construir una api REST, para hacer altas, bajas cambios de usuarios, documentar la API. | |
Utilizar las siguientes tecnologias. | |
* Spring Boot | |
* PostgreSQL hibernate o Gorm | |
* Gradle | |
La aplicacion debe de estar versionada en GitHub y de correr con el comando: gradle bootRun | |
Se va a correr una prueba funcional a la API. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Kata { | |
static String WhatIsTheTime(timeInMirror) { | |
def hoursAndMinutes = timeInMirror.split(':').collect{it.toInteger()} | |
def hours = hoursAndMinutes[1] == 0? 12 :11 | |
if(hoursAndMinutes[0] < 12) { | |
hoursAndMinutes[0] = hours-hoursAndMinutes[0]== 0?12:hours-hoursAndMinutes[0] | |
}else{ | |
hoursAndMinutes[0] = hours | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Kata { | |
static def openOrSenior(data) { | |
data.collect{def values -> | |
values.first() >=55 && values[1] > 7? 'Senior': 'Open' | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Tortoise { | |
public static int[] race(int v1, int v2, int g) { | |
if (v1 >= v2) | |
return null | |
def averageTime = (g*3600).intdiv(v2-v1) | |
[averageTime.intdiv(3600), averageTime.mod(3600).intdiv(60), averageTime.mod(3600).mod(60)] | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Kata{ | |
static int sumDigits(number) { | |
"${number.abs()}".toList().collect{it.toInteger()}.value.sum() | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.groovy.testDictionary | |
class Dictionary { | |
def key | |
def value | |
def dict = [:] | |
Dictionary (){} | |
Dictionary (def key, def value){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
public class TreeNode { | |
TreeNode left; | |
TreeNode right; | |
public static boolean isPerfect(TreeNode root) { | |
if(root == null){ | |
return true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
public class Solution { | |
static TreeNode arrayToTree(int[] array) { | |
TreeNode root = null; | |
if(array.length > 0){ | |
Queue<TreeNode> queue = new LinkedList<TreeNode>(); | |
TreeNode treeNode = new TreeNode(array[0]); | |
queue.add(treeNode); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.regex.Matcher; | |
import java.util.regex.Pattern; | |
public class StringUtils { | |
public static boolean isHexNumber(String s) { | |
boolean b = false; | |
if(s != null){ | |
Pattern p = Pattern.compile("^(0x)?[\\dA-Fa-f]+$"); | |
Matcher m = p.matcher(s); |
NewerOlder