mirror of
https://bitbucket.org/Mattrixwv/projecteulerjava.git
synced 2025-12-06 17:13:58 -05:00
Updated for performance
This commit is contained in:
@@ -1,11 +1,11 @@
|
|||||||
//ProjectEuler/Java/Problem24.java
|
//ProjectEulerJava/src/main/java/mattrixwv/ProjectEuler/Problems/Problem24.java
|
||||||
//Matthew Ellison
|
//Matthew Ellison
|
||||||
// Created: 03-24-19
|
// Created: 03-24-19
|
||||||
//Modified: 03-28-19
|
//Modified: 06-17-20
|
||||||
//What is the millionth lexicographic permutation of the digits 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9?
|
//What is the millionth lexicographic permutation of the digits 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9?
|
||||||
//Unless otherwise listed all non-standard includes are my own creation and available from https://bibucket.org/Mattrixwv/JavaClasses
|
//Unless otherwise listed all non-standard includes are my own creation and available from https://bibucket.org/Mattrixwv/JavaClasses
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2019 Matthew Ellison
|
Copyright (C) 2020 Matthew Ellison
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
@@ -30,7 +30,7 @@ import java.util.ArrayList;
|
|||||||
|
|
||||||
public class Problem24 extends Problem{
|
public class Problem24 extends Problem{
|
||||||
//The number of the permutation I need
|
//The number of the permutation I need
|
||||||
private static final Integer NEEDED_PERM = 1000000; //The number of the permutation that you need
|
private static final int NEEDED_PERM = 1000000; //The number of the permutation that you need
|
||||||
|
|
||||||
public Problem24(){
|
public Problem24(){
|
||||||
super("What is the millionth lexicographic permutation of the digits 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9?");
|
super("What is the millionth lexicographic permutation of the digits 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9?");
|
||||||
@@ -55,5 +55,5 @@ public class Problem24 extends Problem{
|
|||||||
|
|
||||||
/* Results
|
/* Results
|
||||||
The 1 millionth permutation is 2783915460
|
The 1 millionth permutation is 2783915460
|
||||||
It took 1.844 seconds to solve this problem.
|
It took 1.650 seconds to solve this problem.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user