Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 117564

This tag is used for questions which present a problem and multiple solutions, where the asker wishes to know which solution is best (and why).

1 vote

Initializing the edge values of 2D array in Java

Regarding 1) Readability should be the mainfocus. Your solution (3) looks the best in my opinion and could be extended to support non-square arrays by dividing the for-loop into two separate loops, o …
Nevay's user avatar
  • 586
2 votes
Accepted

Finding anagrams in Java (space-optimised)

As you are only interested in the value of c-'a'/c-'A' you can replace every usage of Character.getNumericValue(c) - CHARACTER_A_OFFSET with a call to private static int indexOf(char c) { return …
Nevay's user avatar
  • 586