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 io.ktor.application.ApplicationCall | |
| import io.ktor.application.call | |
| import io.ktor.http.HttpMethod | |
| import io.ktor.routing.Route | |
| import io.ktor.routing.Routing | |
| import io.ktor.routing.route | |
| import kotlin.reflect.KFunction | |
| import kotlin.reflect.full.callSuspendBy | |
| import kotlin.reflect.full.declaredMemberFunctions | |
| import kotlin.reflect.jvm.javaType |
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 NotDuplicate { | |
| public static void main(String[] args) { | |
| int[] nums = {1,2,2,1,3,4,4}; | |
| int result = 0; | |
| for (int i = 0; i < nums.length; i++) { | |
| System.out.println("before result : "+result); | |
| result ^= nums[i]; | |
| System.out.println("nums[i] : "+nums[i]); | |
| System.out.println("result : "+result); |
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.io.*; | |
| import java.util.*; | |
| public class Solution { | |
| public static void main(String[] args) { | |
| /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */ | |
| Scanner sc = new Scanner(System.in); |
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.io.*; | |
| import java.util.*; | |
| public class Solution { | |
| public static void main(String[] args) { | |
| /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */ | |
| Scanner sc = new Scanner(System.in); | |
| int n = sc.nextInt(); | |
| int[] inputArr = new int[n]; |
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
| function maxArea(height: number[]): number { | |
| let leftPointer = 0; | |
| let rightPointer = height.length-1; | |
| let minHeight = 0; | |
| let maxArea = 0; | |
| while (leftPointer < rightPointer) { | |
| minHeight = height[leftPointer] < height[rightPointer] | |
| ? height[leftPointer] | |
| : height[rightPointer]; |
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
| function hourglassSum(arr) { | |
| let resArray = Array(4); | |
| let rowLimit = 0; | |
| let colLimit = 0; | |
| for (let i = 1; i<=16; i++) { | |
| if(i%4 == 0 ) { | |
| rowLimit = 0; | |
| } | |
| if(colLimit == 4) { | |
| colLimit = 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
| function maxSubArray(nums: number[]): number { | |
| let current_max = nums[0] | |
| let global_max = nums[0] | |
| if(nums.length == 1) { | |
| return current_max; | |
| } | |
| for (let i= 1 ; i<nums.length ; i++) { | |
| current_max = current_max + nums[i] >= nums[i] ? current_max + nums[i] : nums[i] | |
| global_max = current_max > global_max ? current_max : global_max | |
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
| function kidsWithCandies(candies: number[], extraCandies: number): boolean[] { | |
| let max = 0; | |
| for(let i=0; i<candies.length ; i++ ){ | |
| max = candies[i] > max? candies[i] : max | |
| } | |
| let result = []; | |
| for(let i=0; i<candies.length ; i++ ){ | |
| result.push(candies[i] + extraCandies >= max ? true : false ) | |
| } |
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
| function shuffle(nums: number[], n: number): number[] { | |
| let res = []; | |
| for(let i=0 ; i<n; i++) { | |
| res.push(nums[i]) | |
| res.push(nums[n+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
| #!/bin/sh | |
| input=$(whiptail --inputbox "Encrypt input" 8 39 input --title "Encryption Utility" 3>&1 1>&2 2>&3) | |
| selectedOption=$(whiptail --title "Utilities" \ | |
| --radiolist "Select Utility:" 10 80 3 \ | |
| 1 bcrypt on \ | |
| 2 Argon2i off \ | |
| 3 Argon2iD off \ | |
| 3>&1 1>&2 2>&3) |
NewerOlder