A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
OCA Java SE 8 Programmer I Study Guide 1Z0-808
this week in the
Java in General
Permutations - upper case and lower case
Joined: Mar 17, 2011
Mar 17, 2011 11:11:58
I'm trying to create a
of upper and lower case characters. Where the letters in the string stay in the same position. For example if the sting is ABC the result would be the following.
Any thoughts would be appreciated. Thanks, Lisa
Joined: Oct 13, 2005
Mar 17, 2011 11:30:05
Welcome to the Ranch
Write down how you are going to do it. I suggest you try a recursion:
write the first letter-write the second letter-change the second letter-back
But that is only a small part of it.
Joined: Oct 02, 2003
Mar 17, 2011 12:11:14
Liza Zapson wrote:
It may be of interest to notice that since the letters don't change, the only thing that matters is the case'. so what you have could also be conveyed as
I could replace these with numbers....L=0, U=1...
and then re-arrange those into
Maybe this give you an idea how to proceed...
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Did you see how Paul
cut 87% off of his electric heat bill with 82 watts of micro heaters
subject: Permutations - upper case and lower case
wordings for error message
compare strings case insensitive?
Case Insensative search
Formatter Sytax to convert UPPER to lower
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015