Skip to content

Instantly share code, notes, and snippets.

View AJshewale's full-sized avatar
🎯
Focusing

Ashvini shewale AJshewale

🎯
Focusing
View GitHub Profile
@itugs
itugs / Solution.java
Last active May 29, 2023 01:52
HackerCards for Leanne
public class Solution {
static int[] hackerCards(int[] collection, int d) {
List<Integer> result = new ArrayList<>();
int s, e;
for(int idx = 0; idx <= collection.length; idx++) {
if (idx == 0) s = 1; else s = collection[idx-1] + 1;
if (idx != collection.length) e = collection[idx]; else e = Integer.MAX_VALUE;
if (d < s) break;
for (int k = s; k < e; k++) {
if (k <= d) {