Task Description: Count Unique Substrings in a Pile
Functionality:
Implement the function count_unique_substrings_in_pile(pile, B). This function should determine how many distinct substrings of the string B are present in the string pile. A distinct substring is any contiguous sequence of characters within B.
Input Requirements:
The function takes two parameters:
pile (str): A string in which we will check for the presence of substrings.
B (str): A string from which we will extract all possible substrings.
Output Requirements:
The function should return an integer representing the count of unique substrings of B that are found in pile.
Implementation Notes:
Generate all possible substrings of B.
Ensure that the substrings stored for checking are unique.
Count how many of these unique substrings can be found within pile.
File Structure:
The solution must be written in a file located at /app/solution.py.
Example Usage:
python
# Example invocation
result = count_unique_substrings_in_pile("hello world", "lo")
print(result) # Output should be 1, as "lo" is the only unique substring of "lo" present in the pile.