Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Refactoring for Software Design Smells: Managing Technical Debt
this week in the
OO, Patterns, UML and Refactoring
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
Have you checked out
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