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
| private initSystemDateRangeFilter(): void { | |
| if (this.selectedFilterValue) { | |
| // is date range type from to | |
| if (this.selectedFilterValue.includes("|")) { | |
| this.tempSystemDateRangeSelect = this.customValueConstant; | |
| this.tempDateRangeValue = convertPeriodStringToDateArray(this.selectedFilterValue); | |
| } else { | |
| // is preselected string range type - quarter, last week etc. | |
| this.tempSystemDateRangeSelect = this.selectedFilterValue; | |
| } |
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 Solution { | |
| public int maxVowels(String s, int k) { | |
| Set<Character> vowels = new HashSet<>(5); | |
| vowels.add('a'); | |
| vowels.add('e'); | |
| vowels.add('i'); | |
| vowels.add('o'); | |
| vowels.add('u'); |
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.example.demo; | |
| // Load Balancer simulation | |
| import java.util.Random; | |
| import java.util.concurrent.*; | |
| import java.util.concurrent.atomic.AtomicInteger; | |
| public class DemoApplication { |
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
| /** | |
| * Definition for singly-linked list. | |
| * public class ListNode { | |
| * int val; | |
| * ListNode next; | |
| * ListNode() {} | |
| * ListNode(int val) { this.val = val; } | |
| * ListNode(int val, ListNode next) { this.val = val; this.next = next; } | |
| * } | |
| */ |
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
| import java.util.ArrayList; | |
| import java.util.List; | |
| public class Snail { | |
| public static void main(String[] args) { | |
| int [][] array = { | |
| {1,2,3}, | |
| {4,5,6}, |
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 weirdTasks; | |
| import java.util.ArrayList; | |
| import java.util.Arrays; | |
| import java.util.List; | |
| import java.util.stream.IntStream; | |
| public class PrintMM { | |
| public static void main(String[] args) { |
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 static int maxEvents(List<int> arrival, List<int> duration) | |
| { | |
| var firms = Enumerable.Range(0, arrival.Count) | |
| .Select(i => new Firm(arrival[i], duration[i])) | |
| .ToList(); | |
| int presentations = 0; | |
| int time = 1; | |
| int maxTime = firms.Select(firm => firm.Arrival + firm.Duration).Max(); | |
| //var firmsStr = firms.Aggregate(new StringBuilder(), (sb, firm) => sb.AppendLine(firm.Arrival + " " + //firm.Duration)).ToString(); | |
| //Console.WriteLine("fds " + firmsStr); |
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 UniversityFair { | |
| public static void main(String[] args) { | |
| System.out.println(maxCount(Arrays.asList(1, 3, 3, 5, 7), Arrays.asList(2, 2, 1, 2, 1))); //4 | |
| System.out.println(maxCount(Arrays.asList(1, 3, 4, 5), Arrays.asList(8, 2, 2, 1))); //2 | |
| } | |
| public static int maxCount(List<Integer> arrival, List<Integer> duration) { | |
| return count(arrival, duration, 0, 0); |
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 Solution { | |
| int jumps = Integer.MAX_VALUE; | |
| public int jump(int[] nums) { | |
| if(nums == null || nums.length == 0) { | |
| return 0; | |
| } |
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 FooBar { | |
| private int n; | |
| private int flag = 0; | |
| public FooBar(int n) { | |
| this.n = n; | |
| } |
NewerOlder