This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<style> | |
.node { | |
cursor: pointer; | |
} | |
.node circle { | |
fill: #fff; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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.*; |