Generate automated emails for content moderation based on detected keywords.
Function Signature:
function generateContentModerationEmail(
detectedKeywords: string[],
keywordToCategory: string[],
categoryToInstruction: string[]
): string
Example: Input:
Output:
Subject: Detected Keywords in the Game
Dear User,
Our system has detected the following types of activity in the game:
Hacking: Please ensure that cheating mechanisms are reported promptly to administrators.
Drug: Please be aware of drug dealing in the game, report to police if necessary.
We encourage you to remain vigilant and take the appropriate actions outlined above.
Best regards,
[Your Organization's Name]
Find number of paths in binary tree that sum to target value.
Function Signature:
function pathSum(root: TreeNode, targetSum: number): number
Requirements:
Example: Input:
Output: 3 Paths: [5,4,11,2], [5,8,4,5], [4,11,7]
Solution: Use recursive approach with hashmap for cumulative sums.