Skip to content

Instantly share code, notes, and snippets.

Avatar

Srini Buzz-Lightyear

View GitHub Profile
View combinationSum.java
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))
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.node {
cursor: pointer;
}
.node circle {
fill: #fff;
@Buzz-Lightyear
Buzz-Lightyear / ProjectEulerProblem2
Created Nov 5, 2014
Project Euler Problem 2 - Sum of Even Fibonacci numbers below 4 million
View ProjectEulerProblem2
#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;
View ProjectEulerProblem1
/*
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.*;