Skip to content

Instantly share code, notes, and snippets.

View goyuninfo's full-sized avatar

goyun.info goyuninfo

View GitHub Profile
public class Solution {
public ListNode sortList(ListNode head) {
if (head == null || head.next == null)
return head;
// step 1. cut the list to two halves
ListNode prev = null, slow = head, fast = head;
while (fast != null && fast.next != null) {
UserName = input("Please enter your name: ")
print("Hello " + UserName)
sample = ['goyun.info', 'nextruby.com', 'sqley.com']
for i in sample:
print(i)
package info.goyun;
public class StringBuilderDemo {
public static void main(String[] args) {
StringBuilder str = new StringBuilder("Go.info");
System.out.println("string = " + str);
// insert character value at offset 2
package main
import "fmt"
func main() {
fmt.Println("hello world")
}
import java.io.*;
import java.util.*;
public class Solution {
public static void main(final String[] args) {
final Scanner scan = new Scanner(System.in);
if (!scan.hasNext()) {
System.out.print("0");
return;
import java.util.Scanner;
public class Solution {
public static String getSmallestAndLargest(String str, int k) {
String smallest = "";
String largest = "";
// Complete the function
/* Create NumberFormats using Locales */
NumberFormat us = NumberFormat.getCurrencyInstance(Locale.US);
NumberFormat china = NumberFormat.getCurrencyInstance(Locale.CHINA);
NumberFormat france = NumberFormat.getCurrencyInstance(Locale.FRANCE);
/* Print output */
System.out.println("US: " + us.format(payment));
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class DemoApplication {
import java.util.Arrays;
import java.util.BitSet;
/**
* Find missing elements in a Integer array containing numbers
*/
public class I88CA {
public static void main(String args[]) {