Programming Case Types:
1. camelCase
2. PascalCase
3. snake_case
4. kebab-case
5. UPPERCASE (or SCREAMCASE)
you can also mix...
e.g. SCREAM_SNAKE_CASE
e.g. Pascal-Kebab-Case
thisIsCamelCase
ThisIsPascalCase
this_is_snake_case
this-is-kebab-case
THIS_IS_UPPER_SNAKE_CASE
thisIsCamelCase
String.prototype.camelCase=function(){
return this.split(/[ -_]/g).map(function(word){
return word.charAt(0).toUpperCase() + word.slice(1);
}).join('');
}
camel case words = helloWorld goOut printIn > as you see first word not
capitlized while seconed is.
//User function Template for Java
//User function Template for Java
class Solution
{
static class TrieNode
{
TrieNode child[] = new TrieNode[26];
boolean isEnd = false ;
ArrayList<String> word= new ArrayList<>() ;
public TrieNode()
{
for(int i =0 ;i<26;i++)
{
child[i] = null ;
}
}
}
static void insert(TrieNode root , String key )
{
TrieNode node = root ;
int index ;
for(int i =0 ;i<key.length();i++)
{
char c = key.charAt(i);
if(Character.isLowerCase(c))
{
continue ;
}
index = c - 'A';
if(node.child[index] == null)
{
node.child[index] = new TrieNode();
}
node = node.child[index];
}
node.word.add(key);
node.isEnd =true ;
}
static void printAll(TrieNode root)
{
TrieNode node = root ;
if(node.isEnd)
{
Collections.sort(node.word);
for(int i =0 ;i <node.word.size();i++)
{
System.out.print(node.word.get(i) + " ");
}
}
for(int i=0;i<26;i++)
{
if(node.child[i] != null)
{
printAll(root.child[i]);
}
}
}
static boolean search(TrieNode root , String key)
{
TrieNode node = root ;
for(int i =0 ;i<key.length();i++)
{
int index = key.charAt(i) - 'A';
if(node.child[index] == null)
{
return false ;
}
node = node.child[index];
}
printAll(node);
return true ;
}
static void findAllWords(String[] dict, String pattern)
{
//Your code here
TrieNode root = new TrieNode();
for(String s : dict)
{
insert(root,s);
}
if(!search(root,pattern))
{
System.out.print("No match found");
}
}
}
thisWasTypedInCamelCase
sameWithThis