-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
34 additions
and
22 deletions.
There are no files selected for viewing
Empty file.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
public class SquareDigit { | ||
|
||
public int squareDigits(int n) { | ||
// separar cada dígito de n | ||
List<Integer> listn = new List<Integer>(); | ||
for (x = 0; x < n.length; x++){ | ||
listn.add(x); | ||
} | ||
// recorrer listn para comprobar cuantos dígitos tiene | ||
} | ||
|
||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
# x = object() | ||
# y = object() | ||
x = object() | ||
y = object() | ||
|
||
# x_list = [x] * 10 | ||
# y_list = [y] * 10 | ||
# big_list = [] | ||
x_list = [x] * 10 | ||
y_list = [y] * 10 | ||
big_list = [] | ||
|
||
# big_list = x_list + y_list | ||
big_list = x_list + y_list | ||
|
||
# print("x_list contains %d objects" % len(x_list)) | ||
# print("y_list contains %d objects" % len(y_list)) | ||
# print("big_list contains %d objects" % len(big_list)) | ||
print("x_list contains %d objects" % len(x_list)) | ||
print("y_list contains %d objects" % len(y_list)) | ||
print("big_list contains %d objects" % len(big_list)) | ||
|
||
# # List().count(x) cuenta el número de items que hay con el valor x en la lista | ||
# if x_list.count(x) == 10 and y_list.count(y) == 10: | ||
# print("Almost there...") | ||
# if big_list.count(x) == 10 and big_list.count(y) == 10: | ||
# print("Great!") | ||
# List().count(x) cuenta el número de items que hay con el valor x en la lista | ||
if x_list.count(x) == 10 and y_list.count(y) == 10: | ||
print("Almost there...") | ||
if big_list.count(x) == 10 and big_list.count(y) == 10: | ||
print("Great!") |
This file contains 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