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 main | |
import ( | |
"context" | |
"fmt" | |
"log" | |
"net" | |
"github.com/google/gopacket" | |
"github.com/google/gopacket/layers" |
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 main | |
import ( | |
"context" | |
"fmt" | |
"log" | |
"net" | |
"syscall" | |
"github.com/google/gopacket" |
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 main | |
import ( | |
"fmt" | |
"net/http" | |
"sync" | |
) | |
func homeRouteHandler(w http.ResponseWriter, r *http.Request) { | |
fmt.Fprintf(w, "Hello, you've requested: %s\n", r.URL.Path) |
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.roopesh; | |
public class Main { | |
public static void main(String[] args) { | |
int ans = closureSum(6583); | |
System.out.println(ans); | |
} | |
public static int closureSum(int val) { | |
char[] chars = ("" + val).toCharArray(); |
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.roopesh; | |
import java.util.Arrays; | |
public class Main { | |
public static void main(String[] args) { | |
int[] arr = getIntegerArray(); | |
System.out.println(Arrays.toString(arr)); | |
} |
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.roopesh; | |
import java.util.Scanner; | |
public class Input { | |
public static String integerIn(String out) { | |
Scanner scanner = new Scanner(System.in); | |
System.out.println(out); | |
return scanner.nextLine(); | |
} |
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 src; | |
public class TestQuicksort { | |
public static void main(String[] args) { | |
// NOTE: Make sure to enable assert before running this code. | |
// If you're using IntelliJ, you might be able to use this: | |
// https://intellij-support.jetbrains.com/hc/en-us/community/posts/207014815-How-to-enable-assert | |
int[] a1 = {1, 2, 3}; | |
int[] a2 = {3, 2, 1}; | |
int[] a3 = {}; |