This file contains hidden or 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 Base { | |
| public void base() { | |
| System.out.println("Base.base()"); | |
| } | |
| public void foo() { | |
| System.out.println("Base.foo()"); | |
| } | |
| } |
This file contains hidden or 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.numberstest; | |
| import org.junit.jupiter.api.Test; | |
| import java.util.Arrays; | |
| public class NumbersTest { | |
| @Test | |
| void n() { | |
| printNumbersBuildOfDigitsLessThan(4); |
This file contains hidden or 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 CyclicRotation { | |
| public int[] solution(int[] a, int k) { | |
| int res[] = new int[a.length]; | |
| for (int i = 0; i < a.length; i++) { | |
| int j = (i + k) % a.length; | |
| res[j] = a[i]; | |
| } | |
| return res; | |
| } | |
| } |
This file contains hidden or 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 BinaryGap { | |
| public int solution(int num) { | |
| boolean start = false; | |
| int maxZeroCount = 0; | |
| int zeroCount = 0; | |
| for (; num > 0 ; num = num / 2) { | |
| int b = num % 2; | |
| if (b == 1 && !start) { | |
| start = true; |
This file contains hidden or 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 visitoralternative; | |
| public interface Bird { | |
| } |
This file contains hidden or 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
| #!/bin/sh | |
| pressAnyKey="Press any key to continue" | |
| pressAnyKeySpaces=`echo $pressAnyKey | sed 's/./ /g'` | |
| (git log --pretty="format:%H %s"; echo) | tac | while read line; do | |
| hash=`echo $line | cut -d' ' -f1`; | |
| message=`echo $line | cut -d' ' -f2-`; | |
| git checkout -q $hash; | |
| echo $message; | |
| printf "$pressAnyKey\r" |
This file contains hidden or 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.sunbit; | |
| import java.util.Collection; | |
| import java.util.HashMap; | |
| import java.util.LinkedList; | |
| import java.util.List; | |
| import java.util.Map; | |
| import java.util.Optional; | |
| import java.util.stream.Collectors; | |
| import java.util.stream.Stream; |
This file contains hidden or 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.alexr.exercise; | |
| import org.junit.jupiter.api.Test; | |
| import java.util.Collection; | |
| import java.util.HashMap; | |
| import java.util.List; | |
| import java.util.Map; | |
| import java.util.Optional; |
This file contains hidden or 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.exercise; | |
| import com.fasterxml.jackson.annotation.JsonCreator; | |
| import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |
| import com.fasterxml.jackson.annotation.JsonProperty; | |
| import java.util.Map; | |
| @JsonIgnoreProperties(ignoreUnknown = true) | |
| public class ExchangeRate { |
This file contains hidden or 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.exercise; | |
| import java.util.Comparator; | |
| import java.util.Iterator; | |
| import java.util.List; | |
| import java.util.NoSuchElementException; | |
| import java.util.PriorityQueue; | |
| public class SortedJoiningIterator<T> implements Iterator<T> { | |
| private final PriorityQueue<Head<T>> iterators; |
NewerOlder