Skip to content

Instantly share code, notes, and snippets.

View Buzz-Lightyear's full-sized avatar

Srini Buzz-Lightyear

View GitHub Profile
public class Solution
{
public List<List<Integer>> combinationSum(int[] candidates, int target)
{
List<List<Integer>> sumCombinations = new ArrayList<>();
if(candidates == null || candidates.length == 0)
return sumCombinations;
if((candidates.length == 1) && (target % candidates[0] == 0))
@Buzz-Lightyear
Buzz-Lightyear / index.html
Last active August 29, 2015 14:17 — forked from mbostock/.block
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.node {
cursor: pointer;
}
.node circle {
fill: #fff;
@Buzz-Lightyear
Buzz-Lightyear / ProjectEulerProblem2
Created November 5, 2014 21:24
Project Euler Problem 2 - Sum of Even Fibonacci numbers below 4 million
#include <iostream>
#include "stdint.h"
using namespace std;
int main() {
uint64_t sumOfEvenValues = 2;
for(uint64_t a = 1, b = 2, term = 0;;)
{
term = a + b;
a = b;
/*
Project Euler Question 1:
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9.
The sum of these multiples is 23.
Display the sum of all the multiples of 3 or 5 below 1000.
*/
import java.util.*;
import java.lang.*;