Skip to content

Instantly share code, notes, and snippets.

View VallarasuS's full-sized avatar
🎯
Focusing

Vallarasu Sambathkumar VallarasuS

🎯
Focusing
View GitHub Profile
class Solution {
public int numberOfSteps(int num) {
int steps = 0;
while (num > 0) {
steps++;
if((num & 1) == 0) {
class Solution {
public int numberOfSteps(int num) {
int steps = 0;
while (num > 0) {
steps += 1;
if(num % 2 == 0) {
class Solution {
public List<String> fizzBuzz(int n) {
List<String> results = new ArrayList<String>();
for(int i = 1; i <= n; i++) {
String result = "";
if(i % 3 == 0) {
class Solution {
public int maximumWealth(int[][] accounts) {
int maxWealth = 0;
for(int customer = 0; customer < accounts.length; customer ++) {
int wealth = this.sum(accounts[customer]);
maxWealth = Math.max(maxWealth, wealth);
}
class Solution {
public int[] runningSum(int[] nums) {
for(int i = 1; i < nums.length; i++) {
nums[i] = nums[i - 1] + nums[i];
}
return nums;
}
@VallarasuS
VallarasuS / FindMax.java
Last active February 7, 2023 12:25
Find Maximum from Array of numbers
public class HelloWorld {
public static void main(String [] args) {
int[] input = { 41, 34, 45, 23, 67, 97 };
int max = maximum(input);
System.out.println("Maximum = " + max);
}
@VallarasuS
VallarasuS / HelloWorld.java
Last active February 1, 2023 13:45
JAVA Quick Reference
// JAVA QUICK REFERENCE - This is single line comment.
import java.util.Scanner;
/* This is a multi line comment
A public class named 'HelloWorld' */
public class HelloWorld {
/* This is a 'public' & 'static' method.
Static method belongs to class,
@VallarasuS
VallarasuS / Anagram.java
Created November 25, 2022 13:49
isAnagram
import java.util.HashMap;
public class Anagram {
public static void main(String [] args) {
boolean result = isAnagram("race", "care");
System.out.println(result);
}
@VallarasuS
VallarasuS / firebug-xpath.js
Last active January 30, 2017 01:34 — forked from nfeldman/firebug-xpath.js
Standalone version of XPath Module from Firebug, assumes strings have a trim method
// AMD, Node flavored CommonJS, and old fashion global
(function (global, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define([], factory);
} else if (typeof exports === 'object') {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory();