Skip to content

Problem 10 In dart #184

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions Dart/04. Largest palindrome product/hkp27299.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//Euler 04


bool isPalindrome(String str) {
String s = str.toLowerCase().replaceAll(RegExp(r'[\W_]'), '');
return s == s.split('').reversed.join('');
}

void main() {
int large = 0;
var x;
for (var i = 100; i < 1000; i++) {
for (var j = i; j< 1000; j++){
x = (i*j).toString();
if (isPalindrome(x)){
if(i*j > large){
large = i*j;
}

}

}

}
print(large);
}
30 changes: 30 additions & 0 deletions Dart/10. Summation of primes/hkp27299.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
//Euler 10
import'dart:math';

void main() {

int summ = 0;
for (int i = 2; i <= 2000001; i++) {
if(is_Prime(i)){

summ += i;

}

}print(summ);
}

bool is_Prime(int x){
final lower = sqrt(x).floor();
var div_f = 0;
for (var div =1 ;div<=lower;div++){
if(x % div ==0){
div_f += 1;
}
if(div_f>1){
return false;
}
}
return true;

}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ Happy Contributing! 😃
| 01 | [Multiples of 3 and 5](https://projecteuler.net/problem=1) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| 02 | [Even Fibonacci numbers](https://projecteuler.net/problem=2) | :white_check_mark: | :white_check_mark: | | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | | :white_check_mark: | :white_check_mark: | :white_check_mark: | |
| 03 | [Largest prime factor](https://projecteuler.net/problem=3) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | | :white_check_mark: | :white_check_mark: | | :white_check_mark: | :white_check_mark: | | |
| 04 | [Largest palindrome product](https://projecteuler.net/problem=4) | :white_check_mark: | :white_check_mark: | | :white_check_mark: | | | :white_check_mark: | | :white_check_mark: | | | |
| 04 | [Largest palindrome product](https://projecteuler.net/problem=4) | :white_check_mark: | :white_check_mark: | | :white_check_mark: | | :white_check_mark: | :white_check_mark: | | :white_check_mark: | | | |
| 05 | [Smallest multiple](https://projecteuler.net/problem=5) | :white_check_mark: | | | :white_check_mark: | | | | | :white_check_mark: | | | |
| 06 | [Sum square difference](https://projecteuler.net/problem=6) | :white_check_mark: | :white_check_mark: | | :white_check_mark: | | :white_check_mark: | :white_check_mark: | | :white_check_mark: | | | |
| 07 | [10001st prime](https://projecteuler.net/problem=7) | :white_check_mark: | | | :white_check_mark: | | :white_check_mark: | :white_check_mark: | | | | | |
| 08 | [Largest product in a series](https://projecteuler.net/problem=8) | | | | :white_check_mark: | | | | | | | | |
| 09 | [Special Pythagorean triplet](https://projecteuler.net/problem=9) | :white_check_mark: | | | :white_check_mark: | | | | | | | | |
| 10 | [Summation of primes](https://projecteuler.net/problem=10) | | | | :white_check_mark: | | | :white_check_mark: | | | | | |
| 10 | [Summation of primes](https://projecteuler.net/problem=10) | | | | :white_check_mark: | | :white_check_mark: | :white_check_mark: | | | | | |
| 11 | [Largest product in a grid](https://projecteuler.net/problem=11) | | | | :white_check_mark: | | | :white_check_mark: | | | | | |
| 12 | [Highly divisible triangular number](https://projecteuler.net/problem=12) | | | | :white_check_mark: | | | :white_check_mark: | | | | | |
| 13 | [Large sum](https://projecteuler.net/problem=13) | :white_check_mark: | | | :white_check_mark: | | | | | | | | |
Expand Down