Q- oky a have a sentence wich is a list of words it can contains 
Lower case latters (‘a’---> ‘z’) 
Digitis case (‘0’ → ‘9’) 
Hyphens (‘-’) 
Punctuations (‘!’,’.’,’,)) 
Space 
Q - we have the concept of “token” wich can be seen as valid word oky but need to verify these constrains : 

It only contains lowercase , letters , hyphens , and/or punctuation (no digits ) 
Lzem yukon fem at most ( 0 or 1 ) hyphen , lzem zeda yukon (betwen) two lower case latters 
→ example (“a-b” is a valid one ) 
→ example (“-ab” is not a valid one) 
Lzemn yukon zeda fema at most one punctuation mark oky  (0 or 1 ) 
→ a can mawjouda lzemn ykon fe a5er the index oky 
→ example (ab,) or (cd!) are valide ones 
→ example (a!b) are not valid ones oky 
Q- what is the input &output format ? 

-> sentence :string 
→ output : int 

Q- do have any approach or paradigm to solve this problem ? 

I think of using divide and conquer approach to solve this problem 
→ where each validation condition i will implement into a separate function oky and then combine them all into one main function oky 


Q- i will start of the first one 

It only contains lowercase letters, hyphens, and/or punctuation (no digits).


Q what is the input and output ? for this function 

For the first helper function 
The input : word:string 
The output : bool 

Q- how the logic will be 

We will be initiate a set of digits = {‘0’,.....’9’} 
Traverse the input word char by char if 
Word[i] in set: 
	Return False 
True 

Q next we move the next (third helper function ) here 

Q- what is the input&output format here ? 

—> input: word : string 
—> output: bool 

Q- what is the logic here ? 

Step1 : we initiate a set called puncteation  ('!', '.', and ',')

Step 2 : next we need to check the present of the any ponticuation 

It need to present at most 1 time (0 or 1) 
We can initiate a hashmap = {} 
Compute the length of the word 
// traverse  the chars of the word 
For i in range(n):
	If word[i] in set:
		If word[i] not in hashmap:
			hashmap[word[i]]=1
		Else: 
			hashmap[word[i]]+=1

Now we need to check the size of this hashmap if it’s >1 return false directly 

Elif (we have verify it does not excede the first constrine  at most of punctiaoiotnk) next we need to check word[n] in set : it true then we return True 

Q- now form our work so far i want you need to generate a clean two peusudoCode for me oky 

Sure, I can help you create clean pseudocode for the two helper functions you've described. Below are the pseudocode implementations for:
Checking that a word contains no digits.
Validating the punctuation constraints.

1. Helper Function: Check No Digits
Function Name: hasNoDigits
Description:
This function verifies that the input word does not contain any digit characters ('0' to '9'). It returns True if the word has no digits, and False otherwise.
Pseudocode:
FUNCTION hasNoDigits(word: STRING) RETURNS BOOLEAN
    SET digits = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' }
    
    FOR EACH character IN word DO
        IF character IN digits THEN
            RETURN False
        END IF
    END FOR
    
    RETURN True
END FUNCTION



2. Helper Function: Validate Punctuation Constraints
Function Name: validPunctuation
Description:
This function checks that the word contains at most one punctuation mark ('!', '.', ','). If a punctuation mark is present, it must be the last character in the word. The function returns True if these conditions are met, and False otherwise.
Pseudocode:
FUNCTION validPunctuation(word: STRING) RETURNS BOOLEAN
    SET punctuation = { '!', '.', ',' }
    SET punctuationCount = 0
    SET punctuationPosition = -1
    
    FOR index FROM 0 TO LENGTH(word) - 1 DO
        IF word[index] IN punctuation THEN
            punctuationCount = punctuationCount + 1
            punctuationPosition = index
        END IF
    END FOR
    
    IF punctuationCount > 1 THEN
        RETURN False
    ELSE IF punctuationCount == 1 THEN
        IF punctuationPosition != (LENGTH(word) - 1) THEN
            RETURN False
        END IF
    END IF
    
    RETURN True
END FUNCTION
Explanation of validPunctuation Function:
Initialize Variables:
punctuation: A set containing the valid punctuation characters.
punctuationCount: A counter to track the number of punctuation marks in the word.
punctuationPosition: To store the position of the punctuation mark.
Traverse the Word:
Iterate through each character in the word.
If a character is a punctuation mark, increment the punctuationCount and record its position.
Validate Constraints:
Multiple Punctuations: If more than one punctuation mark is found, return False.
Single Punctuation: If exactly one punctuation mark is present, ensure it's at the end of the word. If not, return False.
Return Result:
If all checks pass, return True.


Q- we need know to check the third condition here oky ? 


There is at most one hyphen '-'. If present, it must be surrounded by lowercase characters ("a-b" is valid, but "-ab" and "ab-" are not valid).


Q- what is the input&output for this helper function 

Input :  word: string 
Output : bool 


Q- what is the logic here? 

First we need to chekc the present of at most one “-’” 
Then we need to get the index of it’s present if it’s valid 
Check the left and right one ? we need to check of valid string oky 

hypthen_count=0
index_hythen=-1 
For i  , char in enumerate(word): 
	If char==”-”: 
		hypthen_count+=1
		index_hypthen=i 
If hyphen_count<=1 and word[index_hythen-1].dtype and word[index_hypten+1] 

Return turr e
Else 
False 


Q- the main logic 

Function (sentence=str)->int: 
		// converte the string input into a list of word separated by empty space 
		words=sentence.split(“”)
		For word in words:
			If helper_1(word) and helper_2(word) and helper_3(word):
				Return True 
		Return False 


Q-  try to orgnzizz all the helpers functions and the main functions into a well formatted functions oky