Skip to content

Instantly share code, notes, and snippets.

View laim2003's full-sized avatar
🏠
at home

Luke laim2003

🏠
at home
View GitHub Profile
import java.util.*;
public class Main {
public static void main(String[] args) {
int[] nums = {1,2,4,5,6};
int target;
target = 5;
// target = 0;
// target = 7;
package com.my.package;
import java.util.Arrays;
import java.util.Scanner;
public class Main {
private static int[] nums = {1,4,5,7,8,9};//Some random SORTED array
private static Scanner sc = new Scanner(System.in);
public static void main(String[] args) {
System.out.println("array ="+ Arrays.toString(nums));
@laim2003
laim2003 / read-write-file.js
Created September 24, 2018 07:48
Read Write to file with javascript
/// write to file
var txtFile = "c:/test.txt";
var file = new File(txtFile);
var str = "My string of text";
file.open("w"); // open file with write access
file.writeln("First line of text");
file.writeln("Second line of text " + str);
file.write(str);
file.close();
@laim2003
laim2003 / read-write-file.js
Created September 24, 2018 07:48
Read Write to file with javascript
/// write to file
var txtFile = "c:/test.txt";
var file = new File(txtFile);
var str = "My string of text";
file.open("w"); // open file with write access
file.writeln("First line of text");
file.writeln("Second line of text " + str);
file.write(str);
file.close();